3.46 \(\int \frac{A+B x+C x^2}{a+c x^2} \, dx\)

Optimal. Leaf size=55 \[ \frac{(A c-a C) \tan ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right )}{\sqrt{a} c^{3/2}}+\frac{B \log \left (a+c x^2\right )}{2 c}+\frac{C x}{c} \]

[Out]

(C*x)/c + ((A*c - a*C)*ArcTan[(Sqrt[c]*x)/Sqrt[a]])/(Sqrt[a]*c^(3/2)) + (B*Log[a + c*x^2])/(2*c)

________________________________________________________________________________________

Rubi [A]  time = 0.0525633, antiderivative size = 55, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 20, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.2, Rules used = {1810, 635, 205, 260} \[ \frac{(A c-a C) \tan ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right )}{\sqrt{a} c^{3/2}}+\frac{B \log \left (a+c x^2\right )}{2 c}+\frac{C x}{c} \]

Antiderivative was successfully verified.

[In]

Int[(A + B*x + C*x^2)/(a + c*x^2),x]

[Out]

(C*x)/c + ((A*c - a*C)*ArcTan[(Sqrt[c]*x)/Sqrt[a]])/(Sqrt[a]*c^(3/2)) + (B*Log[a + c*x^2])/(2*c)

Rule 1810

Int[(Pq_)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[Pq*(a + b*x^2)^p, x], x] /; FreeQ[{a,
b}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rule 635

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[-(a*c)]

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 260

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rubi steps

\begin{align*} \int \frac{A+B x+C x^2}{a+c x^2} \, dx &=\int \left (\frac{C}{c}+\frac{A c-a C+B c x}{c \left (a+c x^2\right )}\right ) \, dx\\ &=\frac{C x}{c}+\frac{\int \frac{A c-a C+B c x}{a+c x^2} \, dx}{c}\\ &=\frac{C x}{c}+B \int \frac{x}{a+c x^2} \, dx+\frac{(A c-a C) \int \frac{1}{a+c x^2} \, dx}{c}\\ &=\frac{C x}{c}+\frac{(A c-a C) \tan ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right )}{\sqrt{a} c^{3/2}}+\frac{B \log \left (a+c x^2\right )}{2 c}\\ \end{align*}

Mathematica [A]  time = 0.037828, size = 56, normalized size = 1.02 \[ -\frac{(a C-A c) \tan ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right )}{\sqrt{a} c^{3/2}}+\frac{B \log \left (a+c x^2\right )}{2 c}+\frac{C x}{c} \]

Antiderivative was successfully verified.

[In]

Integrate[(A + B*x + C*x^2)/(a + c*x^2),x]

[Out]

(C*x)/c - ((-(A*c) + a*C)*ArcTan[(Sqrt[c]*x)/Sqrt[a]])/(Sqrt[a]*c^(3/2)) + (B*Log[a + c*x^2])/(2*c)

________________________________________________________________________________________

Maple [A]  time = 0.046, size = 59, normalized size = 1.1 \begin{align*}{\frac{Cx}{c}}+{\frac{B\ln \left ( c{x}^{2}+a \right ) }{2\,c}}+{A\arctan \left ({cx{\frac{1}{\sqrt{ac}}}} \right ){\frac{1}{\sqrt{ac}}}}-{\frac{aC}{c}\arctan \left ({cx{\frac{1}{\sqrt{ac}}}} \right ){\frac{1}{\sqrt{ac}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((C*x^2+B*x+A)/(c*x^2+a),x)

[Out]

C*x/c+1/2*B*ln(c*x^2+a)/c+1/(a*c)^(1/2)*arctan(x*c/(a*c)^(1/2))*A-1/c/(a*c)^(1/2)*arctan(x*c/(a*c)^(1/2))*a*C

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((C*x^2+B*x+A)/(c*x^2+a),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 1.73884, size = 296, normalized size = 5.38 \begin{align*} \left [\frac{2 \, C a c x + B a c \log \left (c x^{2} + a\right ) +{\left (C a - A c\right )} \sqrt{-a c} \log \left (\frac{c x^{2} - 2 \, \sqrt{-a c} x - a}{c x^{2} + a}\right )}{2 \, a c^{2}}, \frac{2 \, C a c x + B a c \log \left (c x^{2} + a\right ) - 2 \,{\left (C a - A c\right )} \sqrt{a c} \arctan \left (\frac{\sqrt{a c} x}{a}\right )}{2 \, a c^{2}}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((C*x^2+B*x+A)/(c*x^2+a),x, algorithm="fricas")

[Out]

[1/2*(2*C*a*c*x + B*a*c*log(c*x^2 + a) + (C*a - A*c)*sqrt(-a*c)*log((c*x^2 - 2*sqrt(-a*c)*x - a)/(c*x^2 + a)))
/(a*c^2), 1/2*(2*C*a*c*x + B*a*c*log(c*x^2 + a) - 2*(C*a - A*c)*sqrt(a*c)*arctan(sqrt(a*c)*x/a))/(a*c^2)]

________________________________________________________________________________________

Sympy [B]  time = 0.674107, size = 156, normalized size = 2.84 \begin{align*} \frac{C x}{c} + \left (\frac{B}{2 c} - \frac{\sqrt{- a c^{3}} \left (- A c + C a\right )}{2 a c^{3}}\right ) \log{\left (x + \frac{B a - 2 a c \left (\frac{B}{2 c} - \frac{\sqrt{- a c^{3}} \left (- A c + C a\right )}{2 a c^{3}}\right )}{- A c + C a} \right )} + \left (\frac{B}{2 c} + \frac{\sqrt{- a c^{3}} \left (- A c + C a\right )}{2 a c^{3}}\right ) \log{\left (x + \frac{B a - 2 a c \left (\frac{B}{2 c} + \frac{\sqrt{- a c^{3}} \left (- A c + C a\right )}{2 a c^{3}}\right )}{- A c + C a} \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((C*x**2+B*x+A)/(c*x**2+a),x)

[Out]

C*x/c + (B/(2*c) - sqrt(-a*c**3)*(-A*c + C*a)/(2*a*c**3))*log(x + (B*a - 2*a*c*(B/(2*c) - sqrt(-a*c**3)*(-A*c
+ C*a)/(2*a*c**3)))/(-A*c + C*a)) + (B/(2*c) + sqrt(-a*c**3)*(-A*c + C*a)/(2*a*c**3))*log(x + (B*a - 2*a*c*(B/
(2*c) + sqrt(-a*c**3)*(-A*c + C*a)/(2*a*c**3)))/(-A*c + C*a))

________________________________________________________________________________________

Giac [A]  time = 1.16636, size = 65, normalized size = 1.18 \begin{align*} \frac{C x}{c} + \frac{B \log \left (c x^{2} + a\right )}{2 \, c} - \frac{{\left (C a - A c\right )} \arctan \left (\frac{c x}{\sqrt{a c}}\right )}{\sqrt{a c} c} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((C*x^2+B*x+A)/(c*x^2+a),x, algorithm="giac")

[Out]

C*x/c + 1/2*B*log(c*x^2 + a)/c - (C*a - A*c)*arctan(c*x/sqrt(a*c))/(sqrt(a*c)*c)